﻿package vklib 
{
	import flash.display.Sprite;
	import flash.events.Event;
	/**
	 * ...
	 * @author apisoc@gmail.com
	 */
	public class VkMainSprite extends Sprite
	{
		private var _params:Object;
		
		public function VkMainSprite(params:Object) 
		{
			_params = params;
			addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		public final function init(e:Event):void 
		{
			if (e.type == VkApi.I_AM_READY) 
				run();
			else {
				removeEventListener(e.type, init);
				VkApi.init(this, _params);
			}
		}
		
		protected function run():void
		{
		}
	}

}